import 'package:app_admin/extension/custom_ext.dart';
import 'package:app_admin/pages/main/main_logic.dart';
import 'package:app_admin/res/images.dart';
import 'package:app_admin/res/strings.dart';
import 'package:app_admin/res/styles.dart';
import 'package:app_admin/widgets/title_bar.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

class MainPage extends StatelessWidget {
  final logic = Get.find<MainLogic>();

  MainPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: TitleBar.main(
          title: StrRes.mainPageTitle,
          backgroundColor: Styles.c_0089FF,
        ),
        backgroundColor: Styles.c_FFFFFF,
        body: Column(mainAxisAlignment: MainAxisAlignment.center, children: [
          Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Listener(
                  onPointerDown: logic.btnOrderSet,
                  child: Column(
                      mainAxisAlignment: MainAxisAlignment.center,
                      children: [
                        ImageRes.orderSet.toImage
                          ..width = 80.w
                          ..height = 80.h,
                        10.verticalSpace,
                        "订货单设置".toText..style = Styles.ts_0C1C33_10sp,
                      ])),
              const SizedBox(width: 100),
              Listener(
                  onPointerDown: logic.btnOrder,
                  child: Column(
                      mainAxisAlignment: MainAxisAlignment.center,
                      children: [
                        ImageRes.order.toImage
                          ..width = 80.w
                          ..height = 80.h,
                        10.verticalSpace,
                        "订货单".toText..style = Styles.ts_0C1C33_10sp,
                      ])),
            ],
          ),
          const SizedBox(height: 50),
          Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Listener(
                  onPointerDown: logic.btnOrderPlan,
                  child: Column(
                      mainAxisAlignment: MainAxisAlignment.center,
                      children: [
                        ImageRes.orderPlan.toImage
                          ..width = 80.w
                          ..height = 80.h,
                        10.verticalSpace,
                        "外销生产计划".toText..style = Styles.ts_0C1C33_10sp,
                      ])),
              const SizedBox(width: 100),
              Listener(
                  onPointerDown: logic.btnOrderTaskManager,
                  child: Column(
                      mainAxisAlignment: MainAxisAlignment.center,
                      children: [
                        ImageRes.orderTaskManager.toImage
                          ..width = 80.w
                          ..height = 80.h,
                        10.verticalSpace,
                        "外销任务计划".toText..style = Styles.ts_0C1C33_10sp,
                      ])),
            ],
          ),
          const SizedBox(height: 50),
          Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Listener(
                  onPointerDown: logic.btnReport,
                  child: Column(
                      mainAxisAlignment: MainAxisAlignment.center,
                      children: [
                        ImageRes.orderReport.toImage
                          ..width = 80.w
                          ..height = 80.h,
                        10.verticalSpace,
                        "报表".toText..style = Styles.ts_0C1C33_10sp,
                      ])),
              const SizedBox(width: 200),
            ],
          ),
        ]));
  }
}
